package shard

import "github.com/tietang/go-utils/errs"

const (
	errNotFoundShard         = 30001
	errNotFoundShardResource = 30002
	errKeyGreaterThanZero    = 30101
)

func newShardError(code int, message string) error {
	return &errs.Error{Message: message, Code: code}
}

func keyGreaterThanZeroError(message string) error {
	return _error(errNotFoundShard, "the key is greater than zero", message)
}

func notFoundShardError(message string) error {
	return _error(errNotFoundShard, "Not found shard", message)
}
func notFoundShardResourceError(message string) error {
	return _error(errNotFoundShardResource, "Not found shard resource", message)
}

func _error(innerCode int, innerMessage string, message string) error {
	return &errs.Error{Message: innerMessage + ",cause by: " + message, Code: innerCode}
}
